package com.dao.basic.support;

import java.io.Serializable;
import java.util.List;

import com.dao.basic.IModuleTypesDao;
import com.dao.spring.BaseDao;
import com.pojo.basic.ModuleTypes;

public class ModuleTypesDao extends BaseDao implements IModuleTypesDao {

	@Deprecated 
	public ModuleTypes findRootModuleTypes() {
		return this.findChildModuleTypes(-1).get(0);
	}
	
	@SuppressWarnings("unchecked")
	public List<ModuleTypes> findChildModuleTypes(Integer pid){
		return super.getHibernateTemplate().find("from ModuleTypes mt where mt.pid="+pid+"");
	}

	public Serializable addModuleTypes(ModuleTypes moduleTypes) {
		return super.getHibernateTemplate().save(moduleTypes);
	}

}
